package day01;

import java.util.Scanner;

/**
 * 要求用户从控制台输入一个email地址，然后获取该email的用户名(@之前的内容)
 * @author Xiloer
 *
 */
public class test03 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入您的EMAIL");
        String email = scan.nextLine();
        if (email.indexOf("@")>=1) {
            String username = email.substring(0,email.indexOf("@"));
            System.out.println("username:"+username);
        }else {
            System.out.println("你输入的犯法了");
        }
    }
}
